/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sistemarrhh;

import org.joda.time.DateTime;
import org.joda.time.Interval;

/**
 *
 * @author Renato
 */
public class ProbarJodaTime {

    public static void main (String arg[]){
        DateTime date1,date2,date3,date4;
        date1 = new DateTime(2010, 6, 25, 22, 0, 0, 0);
        date2 = new DateTime(2010, 6, 26, 6, 0, 0, 0);

        date3 = new DateTime(2010, 6, 25, 21, 0, 0, 0);
        date4 = new DateTime(2010, 6, 25, 22, 15, 0, 0);

        Interval interval1 = new Interval(date1, date2);
        Interval interval2 = new Interval(date3, date4);
        Interval interval3=interval1.overlap(interval2);
        System.out.println(interval3.toDuration().getStandardHours()+" - "+interval3.toDuration().getStandardMinutes());
    }
}
